**********************************************************************************	
*** TABLE A6: Dynamic Effect of Hearings on IP Rate, FY 2012 onwards.
**********************************************************************************
			
use "$DATALOC/AgencyLevel.dta", clear
keep if FY>=2012
eststo app_a_2012_1: reghdfe iprate agen_hear_all last_agen_hear ,  a(agency FY, savefe)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace
* Hearing effects by chamber
eststo app_a_2012_2: reghdfe iprate agen_hear_h agen_hear_s last_agen_hear_h last_agen_hear_s,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace
* Unified vs divided government.
eststo app_a_2012_3: reghdfe iprate agen_hear_all last_agen_hear agen_hearXuni last_agenXuni,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	
	
use "$DATALOC/ProgramLevel.dta", clear
keep if FY>=2012
eststo app_p_2012_1: reghdfe iprate agen_hear_all last_agen_hear ,  a(programname FY, savefe) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace
* Hearing effects by chamber
eststo app_p_2012_2: reghdfe iprate agen_hear_h agen_hear_s last_agen_hear_h last_agen_hear_s,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace
* Unified vs divided government.
eststo app_p_2012_3: reghdfe iprate agen_hear_all last_agen_hear agen_hearXuni last_agenXuni,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	
	
*** OUTPUT TABLE
esttab app_a_2012_1 app_a_2012_3 app_a_2012_2 app_p_2012_1 app_p_2012_3 app_p_2012_2 using "$TABLELOC/TableA06.tex", ///
	prehead("\begin{table}[htbp]\centering \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \caption{Dynamic Effect of Hearings on Improper Payment Rate, FY 2012 onwards. Dependent variable is improper payment rate as a percent of all payments.} \resizebox{\textwidth}{!}{ \begin{tabular}{l*{7}{c}} \toprule") ///
	b(a2) fragment ///
	booktabs label se star(** 0.05 *** 0.01)s(fixedyear fixedagency N, label("Fiscal Year FE" "Agency/Program FE" "Observations")) ///
	order(last_agen_hear last_agenXuni last_agen_hear_h last_agen_hear_s agen_hear_all agen_hearXuni agen_hear_h agen_hear_s ) keep(agen* last*) ///
	nomtitles ///
	mgroups("Agency-level" "Program-level", ///
				pattern(1 0 0 1 0 0) ///
				span prefix(\multicolumn{@span}{c}{) suffix(})) ///
	prefoot("\hline") ///
	postfoot("\bottomrule \multicolumn{7}{l}{\footnotesize Standard errors in parentheses; clustered on agency-year for program-level analysis.}\\ \multicolumn{4}{l}{\footnotesize \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\ \end{tabular} } \\ \label{tab:dynamic2012} \end{table}") replace

	

